/**
 * Copyright 2008 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package kiff.service.impl;

import kiff.entity.Forum;
import kiff.entity.ForumAcl;
import kiff.entity.ForumAclEntry;
import kiff.entity.Post;
import kiff.entity.Role;
import kiff.entity.Setting;
import kiff.entity.Topic;
import kiff.entity.User;
import kiff.service.CoreService;
import kiff.service.ForumAclEntryService;
import kiff.service.ForumAclService;
import kiff.service.ForumService;
import kiff.service.InstallService;
import kiff.service.PostService;
import kiff.service.RoleService;
import kiff.service.SettingService;
import kiff.service.TopicService;
import kiff.service.UserService;

import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.TypeLiteral;

/**
 * Service Implementation Module, binds Guice to the service implementations in this package.
 * @author Adam
 * @version $Id: ServiceImplModule.java 78 2009-04-11 17:55:57Z a.ruggles $
 * 
 * Created on Oct 2, 2008 at 11:13:56 PM 
 */
public class ServiceImplModule extends AbstractModule {

	/**
	 * {@inheritDoc}
	 * @see com.google.inject.AbstractModule#configure()
	 */
	@Override
	protected void configure() {
		// Bind to Action Layer Service.
		bind(new TypeLiteral<CoreService<Forum>>() { }).to(ForumServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<ForumAcl>>() { }).to(ForumAclServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<ForumAclEntry>>() { }).to(ForumAclEntryServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<Post>>() { }).to(PostServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<Role>>() { }).to(RoleServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<Setting>>() { }).to(SettingServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<Topic>>() { }).to(TopicServiceImpl.class).in(Scopes.SINGLETON);
		bind(new TypeLiteral<CoreService<User>>() { }).to(UserServiceImpl.class).in(Scopes.SINGLETON);
		// Bind to Interfaces.
		bind(ForumService.class).to(ForumServiceImpl.class).in(Scopes.SINGLETON);
		bind(ForumAclService.class).to(ForumAclServiceImpl.class).in(Scopes.SINGLETON);
		bind(ForumAclEntryService.class).to(ForumAclEntryServiceImpl.class).in(Scopes.SINGLETON);
		bind(PostService.class).to(PostServiceImpl.class).in(Scopes.SINGLETON);
		bind(RoleService.class).to(RoleServiceImpl.class).in(Scopes.SINGLETON);
		bind(SettingService.class).to(SettingServiceImpl.class).in(Scopes.SINGLETON);
		bind(TopicService.class).to(TopicServiceImpl.class).in(Scopes.SINGLETON);
		bind(UserService.class).to(UserServiceImpl.class).in(Scopes.SINGLETON);
		bind(InstallService.class).to(InstallServiceImpl.class).in(Scopes.SINGLETON);
	}

}
